<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>hexo部署项目 | 云飞扬 - 个人博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="命令行安装1npm install -g hexo-cli
初始化1hexo init &amp;lt;folder&amp;gt;
new 新建一篇文章1hexo new [layout] &amp;lt;title&amp;gt;
新建一篇文章。如果没有设置 layout 的话，默认使用 _config.yml 中的 default_layout 参数代替。如果标题包含空格的话，请使用引号括起来。
generate 生成静态">
<meta property="og:type" content="website">
<meta property="og:title" content="hexo部署项目">
<meta property="og:url" content="http://blog.yxxit.com/home/index.html">
<meta property="og:site_name" content="云飞扬 - 个人博客">
<meta property="og:description" content="命令行安装1npm install -g hexo-cli
初始化1hexo init &amp;lt;folder&amp;gt;
new 新建一篇文章1hexo new [layout] &amp;lt;title&amp;gt;
新建一篇文章。如果没有设置 layout 的话，默认使用 _config.yml 中的 default_layout 参数代替。如果标题包含空格的话，请使用引号括起来。
generate 生成静态">
<meta property="og:updated_time" content="2017-01-19T12:07:21.567Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="hexo部署项目">
<meta name="twitter:description" content="命令行安装1npm install -g hexo-cli
初始化1hexo init &amp;lt;folder&amp;gt;
new 新建一篇文章1hexo new [layout] &amp;lt;title&amp;gt;
新建一篇文章。如果没有设置 layout 的话，默认使用 _config.yml 中的 default_layout 参数代替。如果标题包含空格的话，请使用引号括起来。
generate 生成静态">
  
    <link rel="alternate" href="/atom.xml" title="云飞扬 - 个人博客" type="application/atom+xml">
  
  
    <link rel="icon" href="/view/favicon.ico">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/view/css/style.css">
  

</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/view/" id="logo">云飞扬 - 个人博客</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/view/">Home</a>
        
          <a class="main-nav-link" href="/view/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://blog.yxxit.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="page-undefined" class="article article-type-page" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/view/home/index.html" class="article-date">
  <time datetime="2017-01-19T11:57:39.000Z" itemprop="datePublished">2017-01-19</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      hexo部署项目
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="命令行安装"><a href="#命令行安装" class="headerlink" title="命令行安装"></a>命令行安装</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install -g hexo-cli</div></pre></td></tr></table></figure>
<h2 id="初始化"><a href="#初始化" class="headerlink" title="初始化"></a>初始化</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo init &lt;folder&gt;</div></pre></td></tr></table></figure>
<h2 id="new-新建一篇文章"><a href="#new-新建一篇文章" class="headerlink" title="new 新建一篇文章"></a>new 新建一篇文章</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo new [layout] &lt;title&gt;</div></pre></td></tr></table></figure>
<p>新建一篇文章。如果没有设置 <code>layout</code> 的话，默认使用 <code>_config.yml</code> 中的 <code>default_layout</code> 参数代替。如果标题包含空格的话，请使用引号括起来。</p>
<h2 id="generate-生成静态文件"><a href="#generate-生成静态文件" class="headerlink" title="generate 生成静态文件"></a>generate 生成静态文件</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo generate</div></pre></td></tr></table></figure>
<p>-d, –deploy    文件生成后立即部署网站<br>-w, –watch    监视文件变动</p>
<h2 id="publish-发表草稿。"><a href="#publish-发表草稿。" class="headerlink" title="publish 发表草稿。"></a>publish 发表草稿。</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo publish [layout] &lt;filename&gt;</div></pre></td></tr></table></figure>
<h2 id="server"><a href="#server" class="headerlink" title="server"></a>server</h2><ul>
<li>启动服务器。默认情况下，访问网址为： <a href="http://localhost:4000/。" target="_blank" rel="external">http://localhost:4000/。</a><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo server</div></pre></td></tr></table></figure>
</li>
</ul>
<p>-p, –port    重设端口<br>-s, –static    只使用静态文件<br>-l, –log    启动日记记录，使用覆盖记录格式</p>
<h2 id="deploy-部署网站。"><a href="#deploy-部署网站。" class="headerlink" title="deploy 部署网站。"></a>deploy 部署网站。</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo deploy</div></pre></td></tr></table></figure>
<p>-g, –generate    部署之前预先生成静态文件</p>
<h2 id="render-渲染文件。"><a href="#render-渲染文件。" class="headerlink" title="render 渲染文件。"></a>render 渲染文件。</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo render &lt;file1&gt; [file2] ...</div></pre></td></tr></table></figure>
<p>-o, –output    设置输出路径</p>
<h2 id="clean"><a href="#clean" class="headerlink" title="clean"></a>clean</h2><p>清除缓存文件 (db.json) 和已生成的静态文件 (public)。</p>
<h2 id="部署成功结果"><a href="#部署成功结果" class="headerlink" title="部署成功结果"></a>部署成功结果</h2><ul>
<li><a href="http://blog.yxxit.com/">http://blog.yxxit.com/</a></li>
</ul>
<h2 id="部署错误"><a href="#部署错误" class="headerlink" title="部署错误"></a>部署错误</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">&gt; /usr/local/bin/jekyll build --safe</div><div class="line">Configuration file: /data/_config.yml</div><div class="line">jekyll 3.3.0 | Error:  The landscape theme could not be found.</div></pre></td></tr></table></figure>
<p>在根目录下建一个.nojekyll空文件就可以了，因为Coding默认支持Jekyll搭建网站</p>
<h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><ul>
<li><a href="https://hexo.io/zh-cn/docs/themes.html" target="_blank" rel="external">hexo.io 官网</a></li>
<li><a href="https://segmentfault.com/a/1190000002900848?utm_source=tuicool" target="_blank" rel="external">在 Coding 上搭建 Hexo 个人博客！</a></li>
<li><a href="http://www.jianshu.com/p/67c57c70f275" target="_blank" rel="external">hexo 部署至Git遇到的坑</a></li>
<li><a href="http://wp.huangshiyang.com/hexo%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88" target="_blank" rel="external">hexo常见问题解决方案</a></li>
<li><a href="https://segmentfault.com/a/1190000003710962?_ea=336354" target="_blank" rel="external">hexo博客搭建时遇到的一些问题</a></li>
<li><a href="http://ued.ctrip.com/blog/play-with-git-webhook-application.html" target="_blank" rel="external">玩转git之webhook应用初探</a></li>
<li><a href="https://xuanwo.org/2014/08/14/hexo-usual-problem/" target="_blank" rel="external">Hexo常见问题解决方案</a></li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://blog.yxxit.com/home/index.html" data-id="ciy4br9rc00032kddb5onqnrx" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/view/tags/node-js-规范/">node.js, 规范</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/view/tags/node-js-规范/" style="font-size: 10px;">node.js, 规范</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/view/archives/2017/03/">March 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/view/archives/2017/02/">February 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/view/archives/2017/01/">January 2017</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/view/2017/03/21/npm/">npm 常用命令</a>
          </li>
        
          <li>
            <a href="/view/2017/03/21/git/">Git 常用命令</a>
          </li>
        
          <li>
            <a href="/view/2017/03/05/windows nginx natapp/">windows nginx natapp</a>
          </li>
        
          <li>
            <a href="/view/2017/02/17/node.js 模块之 pm2/">node.js 模块之 pm2</a>
          </li>
        
          <li>
            <a href="/view/2017/02/16/node.js 6.9.4 升级/">node.js 6.9.4 升级</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2017 coolshaw<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/view/" class="mobile-nav-link">Home</a>
  
    <a href="/view/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>


  <link rel="stylesheet" href="/view/fancybox/jquery.fancybox.css">
  <script src="/view/fancybox/jquery.fancybox.pack.js"></script>


<script src="/view/js/script.js"></script>

  </div>
</body>
</html>